const sm4 = require('./sm4');

class SM4 {
  constructor(key, padding) {
    this.key = key;
    this.padding = padding || 'pkcs#5';
  }
  encrypt(plaintext) {
    return sm4.encrypt(plaintext, this.key, { padding: this.padding });
  }
  decrypt(ciphtext) {
    return sm4.decrypt(ciphtext, this.key, { padding: this.padding });
  }
}

module.exports = SM4;
